package com.jing.taobao.service.user;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.jing.taobao.mapper.user.TbUserMapper;
import com.jing.taobao.pojo.user.TaobaoUser;

/**
 * 淘宝用户的Service
 * @author jing.yue
 * @version 2012/10/22 1.0.0
 */
@Component
public class TbUserService {

	@Autowired
	private TbUserMapper tbUserMapper;

	/**
	 * 根据用户获取对象
	 * @param username
	 * @return
	 * @throws Exception
	 */
	public TaobaoUser findByUsername(String username) throws Exception {
		return tbUserMapper.findByUsername(username);
	}

	/**
	 * 保存信息
	 * @param tbUser
	 * @throws Exception
	 */
	public void saveTaobaoUser(TaobaoUser tbUser) throws Exception {
		tbUserMapper.saveTaobaoUser(tbUser);
	}

	/**
	 * 更新信息
	 * @param tbUser
	 * @throws Exception
	 */
	public void updateTaobaoUser(TaobaoUser tbUser) throws Exception {
		tbUserMapper.updateTaobaoUser(tbUser);
	}

}